package com.zr.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.zr.dao.DeleteJLDaoljc;
import com.zr.util.JDBCUtil;

public class DeleteJLDaoImplljc implements DeleteJLDaoljc{
	//通过id删除记录
	@Override
	public boolean deleteJLById(int id) {
		boolean flag = false;
		StringBuffer sql = new StringBuffer("");
		sql.append(" DELETE FROM blog");
		sql.append(" WHERE blog.id=?");
		Connection con = JDBCUtil.getConnection();
		try {
			PreparedStatement pst = con.prepareStatement(sql.toString());
			pst.setInt(1, id);
			int i = pst.executeUpdate();
			if(i>0){
				flag=true;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return flag;
	}
	}

